# Claude Code Deployment ***Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.*** --- This document describes the basic steps to install, configure, and use Claude Code on Quectel Pi H1. Claude Code assists in the terminal with tasks such as code writing, file modification, command execution, and project analysis, making it suitable for board-level application development, script debugging, and sample project validation. For the official Claude Code documentation, please refer to: [Claude Code Docs](). # Prerequisites Before proceeding with the installation, ensure the following conditions are met: - The device is connected to the network; - The current user has `sudo` privileges; - You have obtained the Claude Code service address, access token, and model name configuration parameters. In the examples below, replace ````, ````, and ```` with the actual parameters you have obtained. # Installation Steps ## Install Basic Tools Update the system package list and install basic tools such as `curl`, `git`, etc.: ```bash sudo apt update sudo apt install -y curl git ca-certificates build-essential jq ``` ## Install Node.js 22 Claude Code is installed via npm. Node.js 22 or later is recommended. Install Node.js 22 via NodeSource: ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs ``` After installation, verify the Node.js and npm versions: ```bash node -v npm -v ``` If the terminal outputs version numbers, the Node.js environment is ready. ## Install Claude Code Install Claude Code globally using npm: ```bash sudo npm install -g @anthropic-ai/claude-code ``` After installation, verify Claude Code is available: ```bash claude --version ``` If the terminal outputs a version number, the installation was successful. # Configuring Access Parameters ## Using the Official Service If you are using the official Claude Code service directly, set the access token in your current terminal: ```bash export ANTHROPIC_AUTH_TOKEN= ``` ## Using a Proxy or Enterprise Gateway If accessing through a proxy service or enterprise gateway, configure the service address, access token, and model parameters: ```bash export ANTHROPIC_BASE_URL=export ANTHROPIC_AUTH_TOKEN=export API_TIMEOUT_MS=600000export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1export ANTHROPIC_MODEL=export ANTHROPIC_SMALL_FAST_MODEL= ``` Parameter descriptions: | **Parameter** | **Description** | | --- | --- | | ANTHROPIC_BASE_URL | API service address. Usually not required for the official service. | | ANTHROPIC_AUTH_TOKEN | Claude Code access token. | | API_TIMEOUT_MS | API request timeout. Increase if the network or model response is slow. | | CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Set to 1 to disable non-essential traffic. | | ANTHROPIC_MODEL | Default primary model. | | ANTHROPIC_SMALL_FAST_MODEL | Default lightweight fast model. | The `export` commands above only take effect in the current terminal session. To make them persistent, add the environment variables to `~/.bashrc` or another shell configuration file. # Starting Claude Code After completing the installation and environment variable configuration, start Claude Code from the terminal: ```bash claude ``` On the first launch, Claude Code may perform login verification, configuration confirmation, or permission prompts. Follow the on-screen instructions to complete the initialization. # Usage Examples ## Generating GPIO LED Blinking Code Navigate to your project directory and describe your task directly to Claude Code. ```plaintext Refer to the Quectel Pi H1 40-Pin expansion documentation, write and run a test program to control GPIO_36 for LED blinking. GPIO_36 corresponds to physical pin Pin3. ``` For pin-related documentation, refer to: [40-Pin expansion](<../../Usage guide/40-Pin expansion/40-Pin expansion.md>). ```{image} images/image_VMEXbOlLco9s1Gxv37lc2TgOnNe.webp :width: 701px :height: 562px ``` ```{image} images/image_U5oqbAxOroL4dPxYpwocODltnqf.webp :width: 692px :height: 408px ``` ```{image} images/image_OevZblECSoRqEuxdUbmcuXHgnNg.webp :width: 670px :height: 417px ``` Before executing hardware control tasks, it is recommended to verify the following: - The target pin is not currently occupied by I2C, SPI, UART, or other system functions; - The GPIO voltage level is compatible with the peripheral; - The current user has permission to access the GPIO device nodes. ## Analyzing Project Code Structure Navigate to the project directory and start Claude Code: ```bash cd ~/my_project claude ``` Enter a task description in the Claude Code interactive interface, for example: ```plaintext Analyze the code structure of the current project, listing the main modules, entry files, and dependencies. ``` Claude Code will automatically read the project files and directories, outputting a code structure overview, module division, and call relationships to help you quickly understand the overall architecture of an unfamiliar project. ```{image} images/image_RhLnbYboBoS3hix75UzcPr4sn0b.webp :width: 694px :height: 452px ``` ```{image} images/image_SIK6bJwVkozWmaxMTPRcurfPn2g.webp :width: 705px :height: 453px ``` # Common Commands Check Claude Code version: ```bash claude --version ``` View Claude Code help information: ```bash claude --help ``` Enter a project directory and start Claude Code: ```bash cd claude ``` Manage conversations: | **Command** | **Function** | | --- | --- | | claude --continue | Resume the most recent session in the current directory | | claude --resume | Open the Session Manager | | claude --resume `` | Resume a named session directly | | claude --from-pr `` | Resume a session linked to that pull request | | /resume | Switch to a different conversation from within an active session | # Troubleshooting - If `claude` is not found after installation, verify that the npm global installation succeeded and that the npm global bin directory is in your `PATH`; - If `npm install` is slow, configure an npm mirror source based on your network environment and reinstall; - If authentication fails at startup, check whether `ANTHROPIC_AUTH_TOKEN` is configured correctly; - If unable to connect after configuring a proxy or enterprise gateway, verify `ANTHROPIC_BASE_URL`, the model name, and network connectivity; - For hardware control tasks, first confirm the pin multiplexing configuration, GPIO access permissions, and peripheral connections.